package com.td.core.obj;

import com.td.core.communication.Sendable;

public class PlayerStats implements Sendable<PlayerStats>{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	String name;
	int level;
	int totalGold;
	int points;
	int killedUnits;
	int passedUnits;
	int builtTowers;
	int totalBullets;
	
	public PlayerStats() {
		
	}
	
	public void incrementLevel() {
		level++;
	}
	public void incrementKilledUnits() {
		killedUnits++;
	}
	public void incrementPassedUnits() {
		passedUnits++;
	}
	public void incrementBuiltTower() {
		builtTowers++;
	}
	public void incrementTotalBullet() {
		totalBullets++;
	}
	public void addGold(int gold) {
		totalGold += gold;
	}
	public void addPoint(int p) {
		points += p;
	}
	
	public int getLevel() {
		return level;
	}

	public int getTotalGold() {
		return totalGold;
	}

	public int getPoints() {
		return points;
	}

	public int getKilledUnits() {
		return killedUnits;
	}

	public int getPassedUnits() {
		return passedUnits;
	}

	public int getBuiltTowers() {
		return builtTowers;
	}

	public int getTotalBullets() {
		return totalBullets;
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setBuiltTowers(int builtTowers) {
		this.builtTowers = builtTowers;
	}
	
	public void setPassedUnits(int passedUnits) {
		this.passedUnits = passedUnits;
	}

	public PlayerStats(PlayerStats stats) {
		
		this.totalGold = stats.totalGold;
		this.points = stats.points;
		this.killedUnits = stats.killedUnits;
		this.passedUnits = stats.passedUnits;
		this.builtTowers = stats.builtTowers;
		this.level = stats.level;
		this.totalBullets = stats.totalBullets;
		this.name = stats.name;
	}

	public void setPoints(int points) {
		this.points = points;
	}

	@Override
	public void copyTo(PlayerStats obj) {
		
		obj.level = this.level;
		obj.totalGold = this.totalGold;
		obj.points = this.points;
		obj.killedUnits = this.killedUnits;
		obj.passedUnits = this.passedUnits;
		obj.builtTowers = this.builtTowers;
		obj.totalBullets = this.totalBullets;
		obj.name = this.name;
		
	}

	@Override
	public PlayerStats getCopy() {
		return new PlayerStats(this);
	}

}
